﻿using System;
using System.Data;
using System.Data.Common;
using Hxj.Data;
using Hxj.Data.Common;

namespace Utility.Model
{

    /// <summary>
    /// 实体类TB_SMS_Log 。(属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]
    public class TB_SMS_Log : Entity
    {
        public class _
        {
            public static readonly Field All = new Field("*", "TB_SMS_Log");

            public static readonly Field ID = new Field("ID", "TB_SMS_Log", "主键ID");

            public static readonly Field SMSID = new Field("SMSID", "TB_SMS_Log", "消息表ID");

            public static readonly Field Mobile = new Field("Mobile", "TB_SMS_Log", "Mobile");

            public static readonly Field QQ = new Field("QQ", "TB_SMS_Log", "QQ");

            public static readonly Field WebChat = new Field("WebChat", "TB_SMS_Log", "WebChat");

            public static readonly Field RtxLoginName = new Field("RtxLoginName", "TB_SMS_Log", "RtxLoginName");

            public static readonly Field SendDate = new Field("SendDate", "TB_SMS_Log", "发送日期");

            public static readonly Field SendMessage = new Field("SendMessage", "TB_SMS_Log", "发送内容");

            public static readonly Field SendStatus = new Field("SendStatus", "TB_SMS_Log", "发送状态");

            public static readonly Field SendUserName = new Field("SendUserName", "TB_SMS_Log", "SendUserName");

            public static readonly Field SendLoginName = new Field("SendLoginName", "TB_SMS_Log", "SendLoginName");

            public static readonly Field SendType = new Field("SendType", "TB_SMS_Log", "发送类型");

            public static readonly Field SystemCode = new Field("SystemCode", "TB_SMS_Log", "SystemCode");
        }

        private string _ID;

        private string _SMSID;

        private string _Mobile;

        private string _QQ;

        private string _WebChat;

        private string _RtxLoginName;

        private DateTime? _SendDate;

        private string _SendMessage;

        private string _SendStatus;

        private string _SendUserName;

        private string _SendLoginName;

        private string _SendType;

        private string _SystemCode;

        public string ID
        {
            get
            {
                return _ID;
            }
            set
            {
                OnPropertyValueChange(_.ID, _ID, value);
                _ID = value;
            }
        }

        public string SMSID
        {
            get
            {
                return _SMSID;
            }
            set
            {
                OnPropertyValueChange(_.SMSID, _SMSID, value);
                _SMSID = value;
            }
        }

        public string Mobile
        {
            get
            {
                return _Mobile;
            }
            set
            {
                OnPropertyValueChange(_.Mobile, _Mobile, value);
                _Mobile = value;
            }
        }

        public string QQ
        {
            get
            {
                return _QQ;
            }
            set
            {
                OnPropertyValueChange(_.QQ, _QQ, value);
                _QQ = value;
            }
        }

        public string WebChat
        {
            get
            {
                return _WebChat;
            }
            set
            {
                OnPropertyValueChange(_.WebChat, _WebChat, value);
                _WebChat = value;
            }
        }

        public string RtxLoginName
        {
            get
            {
                return _RtxLoginName;
            }
            set
            {
                OnPropertyValueChange(_.RtxLoginName, _RtxLoginName, value);
                _RtxLoginName = value;
            }
        }

        public DateTime? SendDate
        {
            get
            {
                return _SendDate;
            }
            set
            {
                OnPropertyValueChange(_.SendDate, _SendDate, value);
                _SendDate = value;
            }
        }

        public string SendMessage
        {
            get
            {
                return _SendMessage;
            }
            set
            {
                OnPropertyValueChange(_.SendMessage, _SendMessage, value);
                _SendMessage = value;
            }
        }

        public string SendStatus
        {
            get
            {
                return _SendStatus;
            }
            set
            {
                OnPropertyValueChange(_.SendStatus, _SendStatus, value);
                _SendStatus = value;
            }
        }

        public string SendUserName
        {
            get
            {
                return _SendUserName;
            }
            set
            {
                OnPropertyValueChange(_.SendUserName, _SendUserName, value);
                _SendUserName = value;
            }
        }

        public string SendLoginName
        {
            get
            {
                return _SendLoginName;
            }
            set
            {
                OnPropertyValueChange(_.SendLoginName, _SendLoginName, value);
                _SendLoginName = value;
            }
        }

        public string SendType
        {
            get
            {
                return _SendType;
            }
            set
            {
                OnPropertyValueChange(_.SendType, _SendType, value);
                _SendType = value;
            }
        }

        public string SystemCode
        {
            get
            {
                return _SystemCode;
            }
            set
            {
                OnPropertyValueChange(_.SystemCode, _SystemCode, value);
                _SystemCode = value;
            }
        }

        public TB_SMS_Log()
            : base("TB_SMS_Log")
        {
            _ID = Guid.NewGuid().ToString();
            _SendDate = DateTime.Now;
        }

        public override Field[] GetPrimaryKeyFields()
        {
            return new Field[2]
            {
            _.ID,
            _.SMSID
            };
        }

        public override Field[] GetFields()
        {
            return new Field[13]
            {
            _.ID,
            _.SMSID,
            _.Mobile,
            _.QQ,
            _.WebChat,
            _.RtxLoginName,
            _.SendDate,
            _.SendMessage,
            _.SendStatus,
            _.SendUserName,
            _.SendLoginName,
            _.SendType,
            _.SystemCode
            };
        }

        public override object[] GetValues()
        {
            return new object[13]
            {
            _ID,
            _SMSID,
            _Mobile,
            _QQ,
            _WebChat,
            _RtxLoginName,
            _SendDate,
            _SendMessage,
            _SendStatus,
            _SendUserName,
            _SendLoginName,
            _SendType,
            _SystemCode
            };
        }

        public override void SetPropertyValues(IDataReader reader)
        {
            _ID = DataUtils.ConvertValue<string>(reader["ID"]);
            _SMSID = DataUtils.ConvertValue<string>(reader["SMSID"]);
            _Mobile = DataUtils.ConvertValue<string>(reader["Mobile"]);
            _QQ = DataUtils.ConvertValue<string>(reader["QQ"]);
            _WebChat = DataUtils.ConvertValue<string>(reader["WebChat"]);
            _RtxLoginName = DataUtils.ConvertValue<string>(reader["RtxLoginName"]);
            _SendDate = DataUtils.ConvertValue<DateTime?>(reader["SendDate"]);
            _SendMessage = DataUtils.ConvertValue<string>(reader["SendMessage"]);
            _SendStatus = DataUtils.ConvertValue<string>(reader["SendStatus"]);
            _SendUserName = DataUtils.ConvertValue<string>(reader["SendUserName"]);
            _SendLoginName = DataUtils.ConvertValue<string>(reader["SendLoginName"]);
            _SendType = DataUtils.ConvertValue<string>(reader["SendType"]);
            _SystemCode = DataUtils.ConvertValue<string>(reader["SystemCode"]);
        }

        public override void SetPropertyValues(DataRow row)
        {
            _ID = DataUtils.ConvertValue<string>(row["ID"]);
            _SMSID = DataUtils.ConvertValue<string>(row["SMSID"]);
            _Mobile = DataUtils.ConvertValue<string>(row["Mobile"]);
            _QQ = DataUtils.ConvertValue<string>(row["QQ"]);
            _WebChat = DataUtils.ConvertValue<string>(row["WebChat"]);
            _RtxLoginName = DataUtils.ConvertValue<string>(row["RtxLoginName"]);
            _SendDate = DataUtils.ConvertValue<DateTime?>(row["SendDate"]);
            _SendMessage = DataUtils.ConvertValue<string>(row["SendMessage"]);
            _SendStatus = DataUtils.ConvertValue<string>(row["SendStatus"]);
            _SendUserName = DataUtils.ConvertValue<string>(row["SendUserName"]);
            _SendLoginName = DataUtils.ConvertValue<string>(row["SendLoginName"]);
            _SendType = DataUtils.ConvertValue<string>(row["SendType"]);
            _SystemCode = DataUtils.ConvertValue<string>(row["SystemCode"]);
        }
    }
}